package dao.domain;

import java.util.Date;

/**
 * @author gzb
 * @Date 2023/9/21
 */
public class Sell {
    /**
     * 顾客对象
     */
    private final Client client;
    /**
     * 书籍对象
     */
    private final Book book;
    /**
     * 订单号
     */
    private int id;
    /**
     * 购买时间
     */
    private Date orderData;

    public Sell(int id, Client client, Book book, Date orderData) {
        this.id = id;
        this.client = client;
        this.book = book;
        this.orderData = orderData;
    }

    public Sell(Client client, Book book) {
        this.client = client;
        this.book = book;
    }


    public Client getClient() {
        return client;
    }

    public Book getBook() {
        return book;
    }

    @Override
    public String toString() {
        return "id:" + id + "\t" +
                "client" + client.getAccount() + "\t" +
                "book" + book.getNumber() + "\t" +
                "orderData" + orderData;
    }
}
